import request from '@/utils/request'

const base_url = '/admin/system/sysRole';

// 分页查询角色数据
export const GetSysRoleListByPage = (pageNum, pageSize, queryDto) => {
  return request({
    url: `${base_url}/findByPage/${pageNum}/${pageSize}`,
    method: 'post',
    data: queryDto,
  })
}

// 添加角色
export const SaveSysRole = (sysRole) => {
  return request({
    url: `${base_url}/saveSysRole`,
    method: 'post',
    data: sysRole,
  })
}

// 修改角色
export const UpdateSysRole = (sysRole) => {
  return request({
    url: `${base_url}/updateSysRole`,
    method: 'put',
    data: sysRole,
  })
}

// 删除角色
export const DeleteSysRole = (roleId) => {
  return request({
    url: `${base_url}/deleteById/${roleId}`,
    method: 'delete',
  })
}